import CryptoJS from 'crypto-js';
export function encrypt3DES(key, plaintext) {
  key = CryptoJS.enc.Utf8.parse(key);
  const ciphertext = CryptoJS.TripleDES.encrypt(plaintext, key, {
    mode: CryptoJS.mode.ECB,
    padding: CryptoJS.pad.ZeroPadding
  }).toString();
  return ciphertext
}

export function decrypt3DES(key, ciphertext) {
  key = CryptoJS.enc.Utf8.parse(key);
  const plaintext = CryptoJS.TripleDES.decrypt(ciphertext, key, {
      mode: CryptoJS.mode.ECB,
      padding: CryptoJS.pad.ZeroPadding
  }).toString(CryptoJS.enc.Utf8);
  return plaintext;
}
